<!-- TicketLinkFormat -->
<template>
    <div>
      <span style="cursor: pointer;text-decoration:underline;" @click="toTicket($data.data[$data.data.column.field])">{{$data.data[$data.data.column.field]}}</span>
    </div>
</template>
<script>
import store from '@/store'
export default {
  data () {
    return {
      templateConfig: {
        fontColor: 'black'
      }
    }
  },
  mounted () {
    if (!this.$data.data.column.templateConfig) {
      this.$data.data.column = { ...this.$data.data.column, ...this.templateConfig }
    }
    this._.merge(this.templateConfig, this.$data.data.column.templateConfig)
  },
  created () {},
  computed: {},
  methods: {
    toTicket (val) {
      if (store.state.user.domainUrl.cwUrl) {
        const url = 'https://' + store.state.user.domainUrl.cwUrl + '/v4_6_release/ConnectWise.aspx?locale=en_US&routeTo=ServiceFV&recid=' + val
        window.open(url, '_blank')
      }
    }
  }
}
</script>
<style>
.data {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}
</style>
